#include <stdio.h>

move(int array[], int n, int m)
{	    		     
    int *p, array_end;

    array_end = *(array + n - 1);
    for (p = array + n - 1; p > array; p--)
    {	    		     
        *p = *(p - 1);
    }
    *array = array_end;
    m--;
    if (m > 0)
    {	    		     
        move(array, n, m);
    }
}	    		     

int main(void)
{	    		     
    int number[20], n, m, i;

    printf("共有多少个数？");
    scanf("%d", &n);
    printf("后移多少个？");
    scanf("%d", &m);
    printf("请以,号为间隔输入%d个数。\n", n);
    for (i = 0; i < n - 1; i++)
    {	    		     
        scanf("%d,", &number[i]);
    }
    scanf("%d", &number[n - 1]);
    move(number, n, m);
    printf("移动后顺序为：\n");
    for (i = 0; i < n - 1; i++)
    {	    		     
        printf("%d,", number[i]);
    }
    printf("%d", number[n - 1]);

    return 0;
}